package simpleFactory;
public class Operation {
    public double num1, num2;
    public double ops(){
        System.out.println("wrong operation");
        return 0d;
    };
    public Operation(double num1, double num2){
        this.num1 = num1;
        this.num2 = num2;
    }
}

class OperationAdd extends Operation{
    OperationAdd(double num1, double num2){
        super(num1, num2);
    }
    @Override
    public double ops() {
        return num1+num2;
    }
}

class OperationSub extends Operation{
    OperationSub(double num1, double num2){
        super(num1, num2);
    }
    @Override
    public double ops() {
        return num1-num2;
    }
}

class OperationMul extends Operation{
    OperationMul(double num1, double num2){
        super(num1, num2);
    }
    @Override
    public double ops() {
        return num1*num2;
    }
}

class OperationDiv extends Operation{
    OperationDiv(double num1, double num2){
        super(num1, num2);
    }
    @Override
    public double ops() {
        return num1/num2;
    }
}